import csv

# 打开CSV文件
with open('test.csv', mode='r') as csvfile:
    # 创建一个csv.reader对象
    csv_reader = csv.reader(csvfile)
    
    # 跳过表头
    next(csv_reader)
    
    # 初始化列表
    time_list = []
    cpu_percent_list = []
    
    # 遍历CSV文件的每一行
    for row in csv_reader:
        # 将time和cpu_percent添加到相应的列表中
        time_list.append(row[0])
        cpu_percent_list.append(float(row[1]))

# 打印结果
print("Time list:", time_list)
print("CPU Percent list:", cpu_percent_list)

""" 
Time list: ['2024-05-28 17:54:57', '2024-05-28 17:55:06']
CPU Percent list: [14.9, 13.7]

"""